package com.tron.sync.controller;

import com.tron.sync.transferElkData.TransferElkDataServer;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "全文检索数据同步")
@RestController
public class TransferElkDataController {

    @Autowired
    TransferElkDataServer transferElkDataServer;


    @ApiOperation(value = "同步Wfinfo索引库")
    @GetMapping("/transferWfinfoElkData")
    public Object transferElk() {
        final Object o = transferElkDataServer.transferWfinfoElkData();
        return "同步条数："+o;
    }

    @ApiOperation(value = "数据域全文检索数据同步（hzy）")
    @GetMapping("/syncEsToDataDomain")
    public String syncEsToDataDomain(@RequestParam("endTime") String endTime){
        transferElkDataServer.syncData(endTime);
        return "0";
    }
}
